<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
 
</head>

<body>
  <div id="app">
    <common-head></common-head>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp();
    const CommonLogo = {
      template: `
        <div>
          <h3>这是子组件</h3>
        </div>
      `
    }
    const CommonHead = {
      template: `
        <div>
          这是公共的头部  
          <common-logo></common-logo>
        </div>
      `,
     
      // 父组件config定义components属性，属性名即为组件名 属性值 config配置对象
      components: {
        CommonLogo
      }
    }
    app.component('CommonHead', CommonHead)

    app.mount('#app')

    
  </script>
</body>

</html>